package com.aqie.appletserver.controller;

import com.aqie.appletserver.bean.response.CommonPictureResponse;
import com.aqie.appletserver.bean.response.FruitVegetablesResponse;
import com.aqie.appletserver.bean.vo.FruitVegetable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("data")
public class DataController {
    @PostMapping("fruit")
    public FruitVegetablesResponse fruit(){
        FruitVegetablesResponse response = new FruitVegetablesResponse();
        List<FruitVegetable> list = new ArrayList<>();
        FruitVegetable fruitVegetable = new FruitVegetable();
        fruitVegetable.setName("苹果");
        fruitVegetable.setScore("1.99999988079071");

        FruitVegetable fruitVegetable2 = new FruitVegetable();
        fruitVegetable2.setName("油菜");
        fruitVegetable2.setScore("1.1175458780599");
        response.setLogId("123");

        list.add(fruitVegetable);
        list.add(fruitVegetable2);
        response.setResult(list);
        response.setResultNum(list.size());
        return response;
    }

    public CommonPictureResponse common() {
        return null;
    }
}
